package com.sh.data.engine.domain.workspace.manager.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sh.data.engine.domain.base.model.PageResult;
import com.sh.data.engine.domain.workspace.manager.model.domain.StorageDetailDomain;
import com.sh.data.engine.domain.workspace.manager.model.domain.StorageListDomain;
import com.sh.data.engine.domain.workspace.manager.model.param.StorageConnectionParam;
import com.sh.data.engine.domain.workspace.manager.model.param.StorageSaveParam;
import com.sh.data.engine.repository.dao.workspace.manager.entity.StorageEntity;

import java.util.Collection;
import java.util.List;

/**
 * 存储管理服务
 *
 * @author: mengzheng.mhc
 * @date: 2024/6/12 15:45
 */
public interface StorageService extends IService<StorageEntity> {

    void saveStorage(StorageSaveParam storageParam);

    List<StorageEntity> findByIds(Collection<Long> storageIds);

    void deleteStorage(Long storageId);

    Boolean testStorage(StorageConnectionParam storageConnectionParam);

    StorageDetailDomain getDetailStorage(Long storageId, boolean encrypt);

    PageResult<StorageListDomain> listStorage(
        Integer pageNum, Integer pageSize, Long lastStorageId, String dsType, String search);

    List<String> getSchemas(String storageLink, String username, String password, Integer dsType);

    StorageEntity tmpGetStorageInfoByProjectId(Long projectId);

    List<StorageEntity> findStorageIsUsable();

    void updateStatusByIds(int status, List<Long> multiStorageId);

    List<StorageListDomain> getAllStorageList();
}
